package com.chilli.cosima.service.impl;

import java.util.Map;

import com.chilli.cosima.common.BussinessException;
import com.chilli.cosima.data.bean.Provider;
import com.chilli.cosima.data.dao.ProviderDAO;
import com.chilli.cosima.service.ProviderService;

public class ProviderServiceImpl implements ProviderService
{
	private ProviderDAO providerDAO;

	public ProviderDAO getProviderDAO()
	{
		return providerDAO;
	}

	public void setProviderDAO(ProviderDAO providerDAO)
	{
		this.providerDAO = providerDAO;
	}

	public Integer createProvider(Provider provider) throws BussinessException
	{
		return providerDAO.createProvider(provider);
	}

	public void deleteProvider(Integer[] id) throws BussinessException
	{
		providerDAO.deleteProvider(id);
	}

	public Provider findProviderById(Integer id)
	{
		return providerDAO.findProviderById(id);
	}

	@SuppressWarnings("unchecked")
	public Map findProviderByPage(int current, int pageSize)

	{
		return providerDAO.findProviderByPage(current, pageSize);
	}

	public void updateProvider(Provider provider) throws BussinessException
	{
		providerDAO.updateProvider(provider);
	}

}
